﻿#region

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Vin.Extension.JwtBearer.Attributes;
using Vin.Tool.AspNetCore.Singleton;

#endregion

namespace Vin.Extension.JwtBearer;

public class ExtensionEntry : IVinExtension
{
    public void AddVinExtension(WebApplicationBuilder builder)
    {
    }

    public void AddVinExtension(IServiceCollection services)
    {
        services.AddJwtAuthentication(VinApp.Configuration);
    }

    public void UseVinExtension(WebApplication app)
    {
        // jwt认证
        // 你是谁
        app.UseAuthentication();
        // 你可以做什么，你有什么权限
        app.UseAuthorization();
    }
}